import collections
class Solution(object):
    def canConstruct(self, ransomNote, magazine):
        """
        :type ransomNote: str
        :type magazine: str
        :rtype: bool
        """
        c1 = collections.Counter(ransomNote)
        c2 = collections.Counter(magazine)
        for key in c1:
            if key not in c2:
                return False
            else:
                if c1[key] > c2[key]:
                    return False
        return True

